<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <link href="/styles/base.css" rel="stylesheet" type="text/css">
    <link href="/js/datepicker/datepicker.css" rel="stylesheet">
    <link href="/styles/wenda.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="/js/wenda.js"></script>
    <#--<script type="text/javascript" src="/js/public.js"></script>-->
    <script>
        $(function(){
            $.get("/question/replynumTop",{},function(data){
                $("#replynumTop").html(data);
            })
            $.get("/question/thumbsupnumTop",{},function(data){
                $("#thumbsupnumTop").html(data);
            })
            $(".query_btn").click(function(){
                var type = $(this).data("type")
                console.log(type);
                window.location.href = "/question?type="+type;
            })
        })

    </script>
</head>

<body style="position: relative;">
<#assign currentNav="question">
    <#include "../common/navbar.ftl">
<div class="wrapper wrapper-new">
    <div class="wrapper wrapper-new">
        <div class="col-main">

            <form action="/q" method="get" >
                <input type="text" name="keyword" class="form-control" id="exampleInputAmount" placeholder="查询问答">
                <input type="hidden" value="4" name="type">
                <button type="submit" id="searchwenda" class="btn btn-primary">点击查询</button>
            </form>
<br>
            <div class="rank _j_rank" style="margin-top: 0px;">
                <div class="bd">
                    <ul class="tab-num" data-cs-p="rank_list">
                        <li class="_j_rank_change_flag query_btn
                        <#if (qo.type??) &&qo.type==-1>on</#if>" data-type="-1" data-cs-d="热门问题">热门问题</li>
                        <li class="_j_rank_change_flag query_btn
                        <#if (qo.type??) &&qo.type==0>on</#if>" data-type="0" data-cs-d="最新问题">最新问题</li>
                        <li class="_j_rank_change_flag query_btn
                        <#if (qo.type??) &&qo.type==1>on</#if>" data-type="1" data-cs-d="待回答问题">待回答问题</li>

                    </ul>
                </div>
            </div>
            <div class="newcate-wrap _j_qa_list">
                <div class="bd newcate-bd">
                    <#list pageInfo.list as question>
                        <ul class="_j_pager_box">
                            <li class="item clearfix _j_question_item" data-qid="793682">
                                <div class="title">
                                    <a href="/question/detail?questionId=${question.id}" target="_blank">${question.title}</a></div>
                                <div class="container">

                                    <div class="avatar"><a href="javascript:;" target="_blank"
                                                           class="_j_filter_click"><img
                                            class="_j_filter_click"
                                            src="${question.author.headImgUrl}"></a>
                                    </div>
                                    <div class="user-info">
                                        <a class="name _j_filter_click" href="javascript:;"
                                           target="_blank">${(question.author.nickname)!}</a>
                                        <a class="level _j_filter_click" href="javascript:;" target="_blank"
                                           rel="nofollow">LV.${(question.author.level)!1}</a>
                                    </div>
                                    <div class="desc clearfix">
                                        <#if (question.oneAnswer??) && question.oneAnswer.coverUrl??>
                                        <img
                                                src="${(question.oneAnswer.coverUrl)!}"
                                                width="150" height="100"></#if>
                                        <p>
                                            ${(question.oneAnswer.summary)!}...
                                        </p>
                                    </div>

                                    <div class="tags">
                                        <#if question.tagList??>
                                            <#list question.tagList as t>
                                                <a class="a-tag _j_filter_click" href="javascript:;" target="_blank">${t}</a>
                                            </#list>
                                        </#if>
                                        <#--<a class="a-tag _j_filter_click" href="javascript:;" target="_blank">美食</a>
                                        <a class="a-tag _j_filter_click" href="javascript:;" target="_blank">呼伦贝尔</a>-->
                                    </div>
                                    <div class="operate">
                                        <div class="zan"><i></i>${(question.thumbsupnum)!0}</div>
                                        <div class="mdd"><a href="javascript:;" class="_j_filter_click" target="_blank"><i
                                                class="_j_filter_click"></i>${(question.dest.name)!}</a></div>
                                        <div class="cate-share">
                                            <a class="_js_showShare _j_filter_click">分享</a>
                                        </div>
                                        <span class="reply">回答 (${(question.replynum)!0})</span>
                                        <span class="browse">浏览 (${(question.viewnum)!0})</span>
                                        <span class="date">发布于${(question.createTime?string("yyyy-MM-dd HH:mm:ss"))!}</span>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </#list>
                </div>
            </div>
        </div>


        <div class="col-side">
            <a href="/question/input" class="btn-ask" title="我要提问">我要提问</a>
            <br>
            <br>
            <div class=" rank _j_rank" style="margin-top: 20px;" id="replynumTop">
            </div>
            <br>
            <br>
            <div class="rank _j_rank" style="margin-top: 20px;" id="thumbsupnumTop">
            </div>
        </div>
    </div>
</body>

</html>